package com.chushouya.product.dto.admin.productsku;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品SKU列表展示DTO
 */
@Data
@ApiModel(value = "商品SKU列表展示DTO")
public class ProductSkuListDTO {

    @ApiModelProperty(value = "SKUID")
    private Long skuId;

    @ApiModelProperty(value = "商品ID")
    private Long productId;

    @ApiModelProperty(value = "商品SKU编码")
    private String skuCode;

    @ApiModelProperty(value = "商品SKU规格")
    private String skuAttrCode;

    @ApiModelProperty(value = "SKU名称")
    private String skuName;

    @ApiModelProperty(value = "SKU最高估价")
    private BigDecimal basePrice;

    @ApiModelProperty(value = "最低评估价")
    private BigDecimal minPrice;

    @ApiModelProperty(value = "估价计算方式")
    private Integer calcType;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "删除标记")
    private Integer delFlag;

    @ApiModelProperty(value = "操作管理员")
    private String handleUser;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 获取状态描述
     */
    public String getStatusDesc() {
        if (status == null) {
            return "未知";
        }
        switch (status) {
            case 0:
                return "下架";
            case 1:
                return "上架";
            default:
                return "未知";
        }
    }

    /**
     * 获取计算方式描述
     */
    public String getCalcTypeDesc() {
        if (calcType == null) {
            return "未知";
        }
        switch (calcType) {
            case 0:
                return "按金额";
            case 1:
                return "按比例";
            default:
                return "未知";
        }
    }
}
